#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTableWidget>
#include <QMessageBox>

#include "Sequent.h"
#include "Agent.h"
#include "Proposition.h"
#include "Disjunction.h"
#include "AtomicProposition.h"
#include "AtomicAction.h"
#include "RApp.h"
#include "RPrApp.h"
#include "NavApp.h"
#include "NavPath.h"
#include "NavFNDyDist.h"
#include "Rule.h"
#include "Configuration.h"
#include "RKernel.h"


#include <cstdlib>
#include <cstdio>
#include <ctype.h>
#include <vector>
#include <string>
#include <sstream>
#include <iostream>
#include <cmath>
#include <fstream>

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:

    void on_mNumVariableSpin_valueChanged(int arg1);

    void on_mClearOutputButton_clicked();

    void on_mProveSequentButton_clicked();

    void on_actionOxford_Map_triggered();

    void on_mShowPDFButton_clicked();

    void on_rule_created(Rule *);

    void on_rule_edited(Rule *);

    void on_mAddRuleButton_clicked();

    void on_actionMatrix_triggered();

    void on_actionMannual_triggered();

    void on_mEditRuleButton_clicked();

    void on_mDeleteRuleButton_clicked();

    void on_actionCoin_Toss_triggered();

    void on_actionBK_s_Map_2_triggered();

    void on_actionStaircase_triggered();

    void on_actionClassic_Map_2_triggered();

    void on_actionMuddyChildren_triggered();

private:
    Ui::MainWindow *ui;
    int mNumVariable;
    std::string mResult;

    bool mIsMannual;

    std::vector<Rule*> mRuleList;

    void loadOxford();

    void clearUI(bool);

    void getPath(NavPath *path, std::vector<AtomicProposition *> variableList, std::vector<std::string> matrix);

    std::vector<AtomicAction*> generateActionList(std::vector<std::string>);

    std::vector<std::string> generateMatrix(QTableWidget*);

    Proposition* getNestedDisjunction(std::vector<AtomicProposition*>);

    std::vector<AtomicProposition*> getUncertainVariables(int variable , std::vector<AtomicProposition*> variableList, std::vector<std::string> matrix);
};

#endif // MAINWINDOW_H
